package typejump.commands;

import typejump.TypeJump;
import typejump.engine.GameEngine;

public class DevShowEditor implements TextCommand {

	@Override
	public boolean matches(String command) {
		return command.matches("dev level editor( [10])?");
	}

	@Override
	public void act(String command) {
		command = command.substring("dev level editor".length()).trim();
		if (command.length() == 0 || command.equals("1")) {
			GameEngine.addTextEffect("OPEN LEVEL EDITOR", "dev");
			TypeJump.getInst().showEditor();
		} else if (command.equals("0")) {
			GameEngine.addTextEffect("CLOSE LEVEL EDITOR", "dev");
			TypeJump.getInst().hideEditor();
		}
	}

}
